package com.guessnumber.guess.chestinterface;

import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.jetbrains.annotations.NotNull;

public class staticpage implements CommandExecutor {
    @Override
    public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
        //staticpage max now min
        if (sender instanceof Player){
            myinv inv = new myinv(6,"STATICPAGE");
            if (args.length != 3) sender.sendMessage("格式不正确！");
            else {
                int max,now,min;
                try {
                    max = Integer.parseInt(args[2]);
                    now = Integer.parseInt(args[1]);
                    min = Integer.parseInt(args[0]);
                }
                catch (Exception e){
                    sender.sendMessage("格式不正确！");
                    return false;
                }
                if (max > 100 || max < 0 || now > 100 || now < 0 || min > 100 || min < 0) sender.sendMessage("格式不正确！");
                /*
                *  #########
                *  100<n<100
                *  #########
                *  #########
                *  ##[###]##
                *  #########
                * */
                ItemStack[] maxi = returnitemstack.returnitemstack(max);
                ItemStack[] nowi = returnitemstack.returnitemstack(now);
                ItemStack[] mini = returnitemstack.returnitemstack(min);
            }
        }
        return false;
    }
}
